using Admin2025.Domain.Entities;
using Microsoft.EntityFrameworkCore;

namespace Admin2025.Infrastructure.Data;

public class AppDbContext : DbContext
{
    public AppDbContext(DbContextOptions<AppDbContext> options) : base(options)
    {
    }

    public DbSet<AppUser> Users { get; set; }
    public DbSet<AppRole> Roles { get; set; }
    public DbSet<AppDepartment> Departments { get; set; }
    public DbSet<AppResource> Resources { get; set; }
    public DbSet<AppPermission> Permissions { get; set; }
    public DbSet<AppPermissionRole> PermissionRoles { get; set; }

    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        base.OnModelCreating(modelBuilder);
        // 在这里配置实体关系和数据约束
    }
}
